package com.sharing.library.controller;

import com.sharing.library.entity.BookType;
import com.sharing.library.repository.BookTypeRepository;
import com.zhx.framework.util.result.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author zhanghaixuan
 * @create 2018/3/17-下午2:03
 **/
@RestController
@RequestMapping("/booktype")
@Api(description="书种类")
public class BookTypeController {

    @Autowired
    private BookTypeRepository bookTypeRepository;

    @PostMapping("/getBookTypeList")
    @ApiOperation(value="获取全部书的种类", notes="获取全部书的种类")
    public Result getBookTypeList(){
        List<BookType> all = bookTypeRepository.findAll();

        return Result.OK("",all);
    }
}
